package com.iussoft.gateway.redis;

import com.iussoft.manager.RedisManager;
import com.iussoft.manager.RedisManagerSuper;
import com.iussoft.tools.JedisPoolFactory;
import com.iussoft.tools.LoggerUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

import java.util.Map;

/**
 * @description: 缓存接口实现
 * @author: Hou Dayu
 * @date: Created in 2020/2/24
 */
@Service("redisManager")
public class RedisManagerImpl extends RedisManagerSuper {

    @Autowired
    private Environment env;

    @Bean("jedisPool")
    public JedisPool initJedisPool() {
        JedisPoolFactory factory = new JedisPoolFactory(env);
        jedisPool = factory.getJedisPool();
        return jedisPool;
    }

}
